package com.tool4j.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.tool4j.entity.TemplateFile;
import com.tool4j.entity.TemplateInfo;
import org.springframework.web.server.ServerWebExchange;

import java.util.List;

/**
 * @author Deng.Weiping
 * @since 2023-11-24 09:02:30
 */
public interface TemplateInfoService extends IService<TemplateInfo> {

    List<TemplateInfo> findAll(Long userId);

    List<TemplateInfo> findList(Long userId);

    TemplateInfo findById(Long id);

    boolean insert(ServerWebExchange exchange, TemplateInfo templateInfo);

    boolean updateFile(ServerWebExchange exchange, TemplateFile templateFile);

    boolean updateFiles(ServerWebExchange exchange, List<TemplateFile> templateFiles);

    int delete(ServerWebExchange exchange, Long id);

    TemplateInfo findDefault(String ormType);

    Long saveFile(TemplateFile templateFile);

    void delFile(Long fileId);

    List<TemplateFile> getFiles(Long id);

    boolean rename(ServerWebExchange exchange, TemplateInfo templateInfo);

    boolean renameFile(ServerWebExchange exchange, TemplateFile templateFile);
}